<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<input type="text" placeholder="姓名" id="t1">
<input type="text" placeholder="工资" id="t2">
<input type="text" placeholder="工作" id="t3">
<input type="button" value="添加" onclick="f()" >
<table border="1">
  <caption>员工列表</caption>
  <tr>
    <th>姓名</th>
    <th>工资</th>
    <th align="center">工作</th>
  </tr>
</table>
<script>
  let d = document.querySelector("#t1");
  let i = document.querySelector("#t2");
  let k = document.querySelector("#t3");
  function f() {
    let tr = document.createElement("tr");
    let td1 = document.createElement("td");
    let td2 = document.createElement("td");
    let td3 = document.createElement("td");
    td1.innerText = d.value;
    td2.innerText = i.value;
    td3.innerText = k.value;
    tr.append(td1,td2,td3);
    let t = document.querySelector("table");
    t.append(tr);
    
  }
</script>
</body>
</html>